<template>
  <div id="app">
    <el-form ref="form" :model="user" label-width="80px">
      <el-form-item label="用户编号">
        <el-input v-model="user.userCode" placeholder="请输入用户编号"></el-input>
      </el-form-item>
      <el-form-item label="密   码">
        <el-input v-model="user.password" placeholder="请输入密码" show-password></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">登录</el-button>
        <el-button>取消</el-button>
      </el-form-item>
    </el-form>
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">用户管理</el-breadcrumb-item>
      <el-breadcrumb-item :to="{ path: '/role' }">角色管理</el-breadcrumb-item>
      <el-breadcrumb-item :to="{ path: '/permission' }">权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>角色分配</el-breadcrumb-item>
      <el-breadcrumb-item>权限分配</el-breadcrumb-item>
    </el-breadcrumb>
    <router-view/>
  </div>
</template>

<script>
export default {
  name: 'App',
  data () {
    return {
      user: {
        userCode: undefined,
        password: undefined
      }
    }
  },
  methods: {
    onSubmit: function () {
      debugger
      this.$axios({
        method: 'post',
        url: '/shiro/login',
        params: this.user
      }).then(result => {
        this.$message(result.data)
      }).catch(e => {
        console.log(e)
      })
    }
  }
}
</script>

<style>
</style>
